package org.devocean.groupbuying.dao;

import java.util.List;

import org.devocean.groupbuying.domain.Deal;
import org.devocean.groupbuying.domain.Discount;
import org.devocean.groupbuying.domain.Formula;
import org.devocean.groupbuying.domain.PurchaseItem;

public interface DealDAO {

	List<Deal> findAllDeals();

	List<Deal> findAllDeals(String lang);

	List<Deal> findDealsbyTag(String lang, String tag);

	List<Deal> findDealsbyProduct(String lang, Integer productID,
			int firstResult, int maxResults);

	long countDeals();

	long countDeals(String lang);
	long countDeals(String lang,Integer productID);

	List<Deal> findDealsEntries(int firstResult, int maxResults);

	List<Deal> findDealsEntries(int firstResult, int maxResults, String lang);

	List<Deal> findNewDealsEntries(int firstResult, int maxResults, String lang);

	List<Deal> findPopularDealsEntries(int firstResult, int maxResults,
			String lang);

	List<Deal> findEndSoonDealsEntries(int firstResult, int maxResults,
			String lang);

	Deal findDealById(int id);

	Deal findDealById(Integer id, String lang);

	void deleteDeal(Integer id);

	Deal saveDeal(Deal deal);

	Deal updateDeal(Deal deal);

	Deal getFeaturedDeal(String lang);

	List<Formula> getFormulasByProductId(Integer productID);

	Discount getDiscountByDealID(Integer dealID, Integer formulaID);

	Deal findDealWithKey(Integer dealID, String lang);

	List<PurchaseItem> findPurchaseItemsByDealID(Integer DealID);

	Long expireDeals();

	Deal findDealByLang(Integer localizationKey, String localizationRequest);

	Deal findDealByArticleLocalization(Integer localizationKey);

	Deal findDealByArticleID(Integer id);

}
